'use strict';

const Service = require('egg').Service;

class UserService extends Service {
    async selectUser(num) {
        return await this.app.mysql.query('select * from zk3 where num=?',[num]);
    }
    async registry(num,username,email,password){
        await this.app.mysql.query('insert into zk3 (num,username,email,password) values (?,?,?,?)',[num,username,email,password])
    }
    async login(username,password){
        return this.app.mysql.query('select * from zk3 where username=? and password=?',[username,password]);
    }
}

module.exports = UserService;
